
<?php
function applyBB($text) 
	{
		$text=htmlentities($text);
		$text = preg_replace("/\[b\](.*)\[\/b\]/Usi", "<b>\\1</b>", $text);
		$text = preg_replace("/\[i\](.*)\[\/i\]/Usi", "<i>\\1</i>", $text);
		$text = preg_replace("/\[u\](.*)\[\/u\]/Usi", "<u>\\1</u>", $text);
		$text = preg_replace("/\[color=(.*)\](.*)\[\/color\]/Usi", "<span style=\"color:\\1\">\\2</span>", $text); 
		$text = preg_replace("/\[hyper=(.*)\](.*)\[\/hyper\]/Usi", "<a href=\"index.php?ID=\\1\">\\2</a>", $text); 
		return $text;
	}
?>
